<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      >
      <f:metadata>
    	   <f:viewParam name="subject" value="#{disciplineBean.subjectId}"/>
    	   <f:viewParam name="term" value="#{disciplineBean.term}"/>
    	   <f:viewParam name="group" value="#{disciplineBean.groupId}"/>
	    </f:metadata>
      <head><title>IGNORED</title></head>
       <body>
      <ui:composition template="/templates/masterLayout.xhtml">
         <ui:define name="windowTitle">
            Редактирование дисциплины
         </ui:define>
         <ui:define name="content">
         <h:panelGroup rendered="#{authBean.loggedIn and authBean.currentUser.isAdministrator}">
<h:form>
<div>
    <h:outputLabel for="term" value="Семестр:" />
    <h:selectOneMenu id="term" value="#{disciplineBean.discipline.term}" required="true">
   		<f:selectItem itemValue="1" itemLabel="1"/>
   		<f:selectItem itemValue="2" itemLabel="2"/>
   		<f:selectItem itemValue="3" itemLabel="3"/>
   		<f:selectItem itemValue="4" itemLabel="4"/>
   		<f:selectItem itemValue="5" itemLabel="5"/>
   		<f:selectItem itemValue="6" itemLabel="6"/>
   		<f:selectItem itemValue="7" itemLabel="7"/>
   		<f:selectItem itemValue="8" itemLabel="8"/>
   		<f:selectItem itemValue="9" itemLabel="9"/>
   		<f:selectItem itemValue="10" itemLabel="10"/>
   		<f:selectItem itemValue="11" itemLabel="11"/>
   		<f:selectItem itemValue="12" itemLabel="12"/>
    </h:selectOneMenu>
</div>
<div>
    <h:outputLabel for="groupIdsss" value="Группа:" />
    <h:selectOneMenu id="groupIdsss" value="#{disciplineBean.discipline.group}" >
   		<f:selectItems value="#{disciplineBean.groups}" var="group" itemLabel="#{group}" itemValue="#{group}"/>
    </h:selectOneMenu>
</div>
<div>
    <h:outputLabel for="subjectId" value="Название предмета:" />
    <h:selectOneMenu id="subjectId" value="#{disciplineBean.discipline.subject}" required="true">
   		<f:selectItems value="#{disciplineBean.subjects}" var="subject" itemLabel="#{subject.name}" itemValue="#{subject}"/>
    </h:selectOneMenu>
</div>
<div>
    <h:outputLabel for="lecturer" value="Преподаватель, ведущий лекции:" />
    <h:selectOneMenu id="lecturer" value="#{disciplineBean.discipline.lecturer}" required="false">
   		<f:selectItem itemValue="" itemLabel="Не указан"/>
   		<f:selectItems value="#{disciplineBean.teachers}" var="teacher" itemLabel="#{teacher.user.shortName}" itemValue="#{teacher}"/>
    </h:selectOneMenu>
</div>
<div>
    <h:outputLabel for="practiceTeacher" value="Преподаватель, ведущий практические занятия:" />
    <h:selectOneMenu id="practiceTeacher" value="#{disciplineBean.discipline.practiceTeacher}" required="false">
   		<f:selectItem itemValue="" itemLabel="Не указан"/>
   		<f:selectItems value="#{disciplineBean.teachers}" var="teacher" itemLabel="#{teacher.user.shortName}" itemValue="#{teacher}"/>
    </h:selectOneMenu>
</div>
<div>
    <h:outputLabel for="laboratoriesTeacher" value="Преподаватель, ведущий лаборатрные занятия:" />
    <h:selectOneMenu id="laboratoriesTeacher" value="#{disciplineBean.discipline.laboratoryTeacher}" required="false">
   		 <f:selectItem itemValue="" itemLabel="Не указан"/>
   		<f:selectItems value="#{disciplineBean.teachers}" var="teacher" itemLabel="#{teacher.user.shortName}" itemValue="#{teacher}"/>
    </h:selectOneMenu>
</div>
<div>
    <h:commandButton value="Сохранить предмет" action="#{disciplineBean.saveDiscipline}" />
</div>
<div>
    <h:commandButton value="Удалить предмет" action="#{disciplineBean.deleteDiscipline}" />
</div>
<div>
    <h:messages />
</div>
</h:form>
</h:panelGroup>
         </ui:define>
      </ui:composition>
   </body>
 </html>
